package com.fox0g.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;//响应码，1、成功 0、失败
    private String msg;//提示信息
    private Object data;//数据
    //增删改
    public static Result success(){
        return new Result(1,"成功",null);
    }

    //查询成功
    public static Result success(Object data){
        return new Result(1,"成功",data);
    }

    //失败
    public static Result error(String msg){
        return new Result(0,msg,null);
    }
}
